package cn.yunhe.server;

import cn.yunhe.dao.IBookDao;
import cn.yunhe.entity.Book;
import cn.yunhe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class BookServer {
    SqlSession session = SqlSessionFactoryUtil.getSqlSession();
    IBookDao bookDao = session.getMapper(IBookDao.class);

    public List<Book> queryBook(String condition,int choose){
        Map<String,Object> map = new HashMap<String, Object>();
        map.put("choose", choose);
        map.put("condition", condition);
        return bookDao.queryBook(map);
    }
}
